#include "stdafx.h"
#include "ckDataSourceFactory.h"
#include "ckFileDataSource.h"
#include "ckFolderDataSource.h"
#include "ckGDBDataSource.h"

namespace ck
{
	DataSourceFactory::DataSourceFactory()
	{
	}


	DataSourceFactory::~DataSourceFactory()
	{
	}

	DataSourceFactory* DataSourceFactory::GetInstance()
	{
		static DataSourceFactory g_dsFactory;
		return &g_dsFactory;
	}

	DataSource*	DataSourceFactory::CreateDataSource(ckDataSourceType type)
	{
		DataSource* pDataSource = NULL;
		switch (type)
		{
		case ckFileDataSource:
			pDataSource = new FileDataSource();
			break;
		case ckFolderDataSource:
			pDataSource = new FolderDataSource();
			break;
		case ckGDBDataSource:
			pDataSource = new GDBDataSource();
			break;;
		}
		return pDataSource;
	}
}

